package cn.edu.sdjzu.xg.eagle.bysj.Mapper;

import cn.edu.sdjzu.xg.eagle.bysj.entity.Reimbursement;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ReimbursementMapper {

    @Select("SELECT * FROM Reimbursement")
    List<Reimbursement> selectAllReimbursements();

    @Select("SELECT * FROM Reimbursement WHERE Reimbursement_ID = #{reimbursement_ID}")
    Reimbursement selectReimbursementById(String reimbursement_ID);

    @Insert("INSERT INTO Reimbursement (Reimbursement_ID, Name, Employee_ID, Reimburse_Amount, Reimbursement_Date, Description) " +
            "VALUES (#{reimbursement_ID}, #{name}, #{employee_ID}, #{reimburse_Amount}, #{reimbursement_Date}, #{description})")
    int insertReimbursement(Reimbursement reimbursement);

    @Update("UPDATE Reimbursement SET Name = #{name}, Employee_ID = #{employee_ID}, Reimburse_Amount = #{reimburse_Amount}, " +
            "Reimbursement_Date = #{reimbursement_Date}, Description = #{description} WHERE Reimbursement_ID = #{reimbursement_ID}")
    int updateReimbursement(Reimbursement reimbursement);

    @Delete("DELETE FROM Reimbursement WHERE Reimbursement_ID = #{reimbursement_ID}")
    int deleteReimbursement(String reimbursement_ID);
}